#pragma once

#include <string>
#include <map>

struct DocumentData
{
	unsigned int index;
	std::string documentName;
	unsigned int length;
};

class DocumentManager
{
public:
	DocumentManager(std::string& filename);
	~DocumentManager();
	DocumentData& GetDocumentData(unsigned int index);
	unsigned int GetDocumentLength( unsigned int index ) { return m_Data[index].length; };
	unsigned int GetCollectionLength() { return m_CollectionLength; };
	unsigned int GetDocumentNumber() { return m_DocumentNumber; };
	unsigned int GetDocumentIndex(std::string& documentName);
	typedef std::map<std::string, unsigned int> DocumentIndexTable;
private:
	DocumentData* m_Data;
	DocumentIndexTable m_DocumentIndexTable;
	unsigned int m_CollectionLength;
	unsigned int m_DocumentNumber;
};
